package com.ruoyi.live.base.security;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class JudgeUser extends LoginUser {

    public JudgeUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        SysUser user = new SysUser();
        user.setUserName(username);
        user.setPassword(password);
        Set<String> permissions = new HashSet<>();
        permissions.add("judger");
        this.setUser(user);
        this.setPermissions(permissions);
    }
}
